<script>
    window.onload = () => {
        const b = Object.is(window.NaN, NaN)

        const Fun = function () {
            this.constructor = function (name) {
                this.name = name
            }
        }
        Fun.prototype.name = 'default name'
        Fun.prototype.constructor = function (name) {
            this.name = name
        }
        
        const funObj = new Fun('obj1')
        
        class Person {
            name = '李四'
            constructor(name) {
                this.name = name
            }
            say() {
                console.log(this.name)
            }
        }
        const zhang = new Person('张三')
        // console.dir(Person.say())
        // console.log(zhang.say())
        class Animal {
            static num = 0
            name = '动物'
            constructor(name) {
                if(name) this.name = name
                this.num++
            }
            say(sayContent) {
                console.log(sayContent || 'say')
            }
        }

        const dog = new Animal()
        console.log(dog)
        console.log(Animal.num)
    }
</script>